home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 5.00 Object = "{94C8DA1F-FDF5-11D0-BB7C-0055003B26DE}#1.0#0"; "mwheel.ocx" Begin VB.Form frmMWTest Caption = "Form1" ClientHeight = 7230 ClientLeft = 60 ClientTop = 345 ClientWidth = 5700 Icon = "MWTest5.frx":0000 LinkTopic = "Form1" ScaleHeight = 7230 ScaleWidth = 5700 StartUpPosition = 3 'Windows Default Begin MouseWheelOCX.MouseWheel MouseWheel1 Left = 4560 Top = 180 _ExtentX = 847 _ExtentY = 847 End Begin VB.VScrollBar VScroll1 Height = 6135 LargeChange = 25 Left = 5340 Max = 500 SmallChange = 5 TabIndex = 6 Top = 960 Width = 255 End Begin VB.HScrollBar HScroll1 Height = 255 LargeChange = 25 Left = 60 Max = -500 SmallChange = 5 TabIndex = 5 Top = 6840 Width = 5115 End Begin VB.OptionButton Option1 Caption = "ControlUnderMouse" Height = 195 Index = 1 Left = 2220 TabIndex = 2 Top = 540 Width = 1935 End Begin VB.OptionButton Option1 Caption = "ControlWithFocus" Height = 195 Index = 0 Left = 120 TabIndex = 1 Top = 540 Width = 1935 End Begin VB.CheckBox Check1 Caption = "Turn on Notifications" Height = 195 Left = 120 TabIndex = 0 Top = 180 Width = 3555 End Begin VB.ListBox List1 Height = 2820 IntegralHeight = 0 'False Left = 60 Sorted = -1 'True TabIndex = 4 Top = 3900 Width = 5115 End Begin VB.TextBox Text1 Height = 2835 Left = 60 MultiLine = -1 'True ScrollBars = 3 'Both TabIndex = 3 Text = "MWTest5.frx":000C Top = 960 Width = 5115 End Attribute VB_Name = "frmMWTest" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long Private Sub MouseWheel1_AfterMouseWheel(ByVal hWnd As Long, ByVal Delta As Long, ByVal Shift As Long, ByVal Button As Long, ByVal x As Long, ByVal y As Long) Select Case hWnd Case Me.hWnd, Option1(0).hWnd, Option1(1).hWnd If Option1(0).Value Then Option1(1).Value = True Else Option1(0).Value = True End If Case Check1.hWnd Check1.Value = Abs(Not CBool(Check1.Value)) End Select End Sub Private Sub MouseWheel1_BeforeMouseWheel(ByVal hWnd As Long, ByVal Delta As Long, ByVal Shift As Long, ByVal Button As Long, ByVal x As Long, ByVal y As Long, Cancel As Boolean) Call UpdateCaption Select Case hWnd Case Text1.hWnd If Button = vbMiddleButton Then Call MouseWheel1.HorzScroll(hWnd, Delta) Cancel = True End If End Select End Sub Private Sub UpdateCaption() ' Query for current number of scrolllines MouseWheel1.Refresh If MouseWheel1.ScrollLines = -1 Then Me.Caption = "ScrollLines: WHEEL_PAGESCROLL" Else Me.Caption = "ScrollLines: " & MouseWheel1.ScrollLines End If End Sub Private Sub Check1_Click() ' Turn on notification for these windows. ' Only required in WinNT. MouseWheel1.hWndNotify(Text1.hWnd) = CBool(Check1.Value) MouseWheel1.hWndNotify(List1.hWnd) = CBool(Check1.Value) End Sub Private Sub Form_Load() Dim i As Long, p As String Dim f As String ' Show form so it looks like something's happening Me.Move (Screen.Width - Me.ScaleWidth) / 2, (Screen.Height - Me.ScaleHeight) / 2 Me.Show Me.Refresh Me.MousePointer = vbHourglass ' Fill text boxes with "stuff" Open Environ("windir") & "\win.ini" For Binary As #1 Text1.Text = Input(LOF(1), 1) Close #1 Text1.Refresh ' Fill listbox with "stuff" f = Dir(Environ("windir") & "\*.*") Do While Len(f) List1.AddItem f f = Dir Loop List1.Refresh ' Turn on mouse wheel notification, and caption Call UpdateCaption Check1.Value = vbChecked Option1(0).Value = True Me.MousePointer = vbDefault End Sub Private Sub Option1_Click(Index As Integer) ' Toggle ScrollWhich property MouseWheel1.ScrollWhich = Index End Sub